3c089d8722494fe67be6809f11c7f7dd38173233,passport/src/main/java/com/continuuity/passport/http/handlers/AccountHandler.java,AccountHandler,deleteVPC,#number#number#,648
Before Change
try {
dataManagementService.deleteVPC(accountId, vpcId);
requestSuccess();
return Response.ok().entity(Utils.getJsonOK()).build();
} catch (VPCNotFoundException e) {
requestFailed(); //Failed request
LOG.error(String.format("VPC not found endpoint: %s %s",
"DELETE /passport/v1/account/{id}/vpc/{vpcId}", e.getMessage()));
return Response.status(Response.Status.NOT_FOUND)
.entity(Utils.getJsonError("VPC not found"))
.build();
} catch (RuntimeException e) {
requestFailed(); //Failed request
LOG.error(String.format("Internal server error endpoint: %s %s",
"DELETE /passport/v1/account/{id}/vpc/{vpcId}", e.getMessage()));
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
.entity(Utils.getJsonError("VPC delete Failed", e.getMessage()))
.build();
}
}
After Change
try {
dataManagementService.deleteVPC(accountId, vpcId);
requestSuccess();
responder.sendString(HttpResponseStatus.OK, Utils.getJsonOK());
} catch (VPCNotFoundException e) {
requestFailed(); //Failed request
LOG.error(String.format("VPC not found endpoint: %s %s",
"DELETE /passport/v1/account/{id}/vpc/{vpcId}", e.getMessage()));
responder.sendString(HttpResponseStatus.NOT_FOUND,
Utils.getJsonError("VPC not found"));
} catch (RuntimeException e) {
requestFailed(); //Failed request
LOG.error(String.format("Internal server error endpoint: %s %s",
"DELETE /passport/v1/account/{id}/vpc/{vpcId}", e.getMessage()));
responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,
Utils.getJsonError("VPC delete Failed", e.getMessage()));
}
}